using System;
using Microsoft.SPOT;

namespace LightOMator.Color
{
    public class RgbColor
    {
        public static RgbColor ColorBlack = new RgbColor(0, 0, 0);
        public static RgbColor ColorRed = new RgbColor(255, 0, 0);
        public static RgbColor ColorGreen = new RgbColor(0, 255, 0);
        public static RgbColor ColorBlue = new RgbColor(0, 0, 255);


        public byte Red { get; set; }
        public byte Green { get; set; }
        public byte Blue { get; set; }

        private double getDutyCycle(byte rgbValue)
        {
            return ((double)rgbValue / 255D);
        }

        public virtual double RedDutyCycle
        {
            get
            {
                return getDutyCycle(Red);
            }
        }
        public virtual double GreenDutyCycle
        {
            get
            {
                return getDutyCycle(Green);
            }
        }
        public virtual double BlueDutyCycle
        {
            get
            {
                return getDutyCycle(Blue);
            }
        }

        public RgbColor(byte red, byte green, byte blue)
        {
            Red = red;
            Green = green;
            Blue = blue;
        }
    }

}
